<template>
  <div class="app-container initializeRoll">
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="120px">

      <el-form-item label="进入模式配置" prop="field101">
        <el-select v-model="formData.field101" placeholder="请选择进入模式配置" clearable :style="{width: '20%'}">
          <el-option v-for="(item, index) in field101Options" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item label="默认费率设置" prop="field102">
        <el-input v-model="formData.field102" placeholder="请输入默认费率设置" clearable :style="{width: '20%'}">
        </el-input>
      </el-form-item>

      <el-form-item label="提现账户设置" prop="field103">
        <el-cascader v-model="formData.field103" :options="field103Options" :props="field103Props"
          :style="{width: '20%'}" placeholder="请选择提现账户设置"></el-cascader>
      </el-form-item>

     
     <el-form-item label="是否实名认证" prop="field104">
        <el-select v-model="formData.field104" placeholder="请选择是否实名认证" clearable :style="{width: '20%'}">
          <el-option v-for="(item, index) in Realame" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>

      <el-form-item size="large">
        <el-button type="primary" @click="submitForm" size="small" round>提交</el-button>
        <el-button @click="resetForm" size="small" round>重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        field101: undefined,
        field102: undefined,
        field103: [1, 22],
        field104: undefined,
      },
      rules: {
        field101: [{
          required: true,
          message: '请选择进入模式配置',
          trigger: 'change'
        }],
        field102: [{
          required: true,
          message: '请输入默认费率设置',
          trigger: 'blur'
        }],
        field103: [{
          required: true,
          type: 'array',
          message: '请至少选择一个field103',
          trigger: 'change'
        }],
        field104: [{
          required: true,
          message: '请选择进入模式配置',
          trigger: 'change'
        }],
      },
      field101Options: [{
        "label": "邀请码必填",
        "value": 1
      }, {
        "label": "邀请码选填",
        "value": 2
      }, {
        "label": "邀请码不填",
        "value": ""
      }],
       Realame: [{
        "label": "不实名",
        "value": 1
      }, {
        "label": "实名",
        "value": 2
      }],
      field103Options: [{
        "label": "银联",
        "value": 1,
        "id": 100,
        "children": [{
          "label": "选项一",
          "value": "00",
          "id": 101
        }, {
          "label": "选项二",
          "value": 44,
          "id": 106
        }]
      }, {
        "label": "支付宝",
        "value": 1,
        "id": 103,
        "children": [{
          "label": "选项一",
          "value": 22,
          "id": 104
        }, {
          "label": "选项二",
          "value": 33,
          "id": 105
        }]
      }],
      field103Props: {
        "multiple": false
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (valid){
          //console.log(this.formData,'提交按钮')
        }
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
